From: mjw@wray-m-3.hpl.hp.com Date: Thu, 30 Sep 2004 15:38:37 +0000 (+0000) Subject: bitkeeper revision 1.1159.96.4 (415c287dKBbK9HPtAge67WfTsJsnwQ) X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~17400^2~550^2~1 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success//%22http:/www.example.com/cgi/success/?a=commitdiff_plain;h=28b770962c5a0fc5ae18d6350479e9bf54b1871d;p=xen.git bitkeeper revision 1.1159.96.4 (415c287dKBbK9HPtAge67WfTsJsnwQ) Delay configuring the new domain during migration to localhost. --- diff --git a/tools/python/xen/xend/XendMigrate.py b/tools/python/xen/xend/XendMigrate.py index a2bf83389f..f1bcf67c67 100644 --- a/tools/python/xen/xend/XendMigrate.py +++ b/tools/python/xen/xend/XendMigrate.py @@ -302,18 +302,18 @@ class XendMigrateInfo(XfrdInfo): self.dst_port, self.live ]) - def xfr_vm_suspend(self, xfrd, val): - def cbok(val): - # Special case for localhost: destroy devices early. - if self.dst_host in ["localhost", "127.0.0.1"]: - self.dominfo.restart_cancel() - self.dominfo.cleanup() - self.dominfo.destroy_console() - return val +## def xfr_vm_suspend(self, xfrd, val): +## def cbok(val): +## # Special case for localhost: destroy devices early. +## if self.dst_host in ["localhost", "127.0.0.1"]: +## self.dominfo.restart_cancel() +## self.dominfo.cleanup() +## self.dominfo.destroy_console() +## return val - d = XfrdInfo.xfr_vm_suspend(self, xfrd, val) - d.addCallback(cbok) - return d +## d = XfrdInfo.xfr_vm_suspend(self, xfrd, val) +## d.addCallback(cbok) +## return d def xfr_migrate_ok(self, xfrd, val): dom = int(sxp.child0(val)) diff --git a/tools/xfrd/xen_domain.c b/tools/xfrd/xen_domain.c index 5e535301b4..feb0d9d02b 100644 --- a/tools/xfrd/xen_domain.c +++ b/tools/xfrd/xen_domain.c @@ -138,7 +138,9 @@ int xen_domain_rcv(IOStream *io, ioctxt->info = iostdout; ioctxt->err = iostderr; ioctxt->configure = domain_configure; - ioctxt->flags |= XCFLAGS_CONFIGURE; + if(!configured){ + ioctxt->flags |= XCFLAGS_CONFIGURE; + } err = xc_linux_restore(xcinit(), ioctxt); *dom = ioctxt->domain; diff --git a/tools/xfrd/xfrd.c b/tools/xfrd/xfrd.c index e2b6e98fa1..2a73d7a64b 100644 --- a/tools/xfrd/xfrd.c +++ b/tools/xfrd/xfrd.c @@ -841,7 +841,14 @@ int xfr_recv(Args *args, XfrState *state, Conn *peer){ Sxpr sxpr; int configured=0; - dprintf(">\n"); + dprintf("> peer=%s\n", inet_ntoa(peer->addr.sin_addr)); + // If receiving from localhost set configured so that that xen_domain_rcv() + // does not attempt to configure the new domain. This is because the old + // domain still exists and will make it fail. + if(peer->addr.sin_addr.s_addr == htonl(INADDR_LOOPBACK)){ + dprintf("> Peer is localhost\n"); + configured = 1; + } err = xen_domain_rcv(peer->in, &state->vmid_new, &state->vmconfig, &state->vmconfig_n, @@ -853,6 +860,7 @@ int xfr_recv(Args *args, XfrState *state, Conn *peer){ err = Conn_sxpr(peer, &sxpr); if(err) goto exit; if(!configured){ + dprintf("> Configuring...\n"); err = xen_domain_configure(state->vmid_new, state->vmconfig, state->vmconfig_n); if(err) goto exit; } @@ -1213,9 +1221,11 @@ int main(int argc, char *argv[]){ int long_index = 0; static const char * LOGFILE = "/var/log/xfrd.log"; +#ifndef DEBUG freopen(LOGFILE, "w+", stdout); fclose(stderr); stderr = stdout; +#endif dprintf(">\n"); set_defaults(args); while(1){